﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace WPFExcelReport
{

    public partial class TSPRULES
    {
        public TSPRULES()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            InitializeComponent();
         }
        public override void Reset()
        {
            base.Reset();
        }
        private void btnResetP_Click(object sender, RoutedEventArgs e)
        {
            Reset();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            CHKFLOW();
            CHKYARNTYPE();
 
        }
        public void CHKFLOW()
        {
            if (dwMaster == null)
                return;
            string ARTSTAGE = dwMaster["ARTSTAGE"].ToString();
            string GSFACH = "";
            FLOW = "";
            switch (app.company)
            {
                case "YGR":
                      GSFACH = dwMaster["P2"].ToString();

                    FLOW = "";
                    if (System.Convert.ToDouble(GSFACH) > 1)
                    {
                        FLOW = "XS000002";
                    }
                    else
                    {
                        FLOW = "XS000001";
                    } 
                    break;
                default:
                case "UBT": 
                     GSFACH = dwMaster["P2"].ToString();
                    FLOW = "";
                    if (System.Convert.ToDouble(GSFACH) > 1)
                    {
                        FLOW = "XS000002";
                    }
                    else
                    {
                        FLOW = "XS000001";
                    }
                    break;
            }
        }
        public void CHKYARNTYPE()
        {
            if (dwMaster == null)
                return;
            string YARNTYPE = dwMaster["P1"].ToString();
        }
    }
}
